package com.hugedata.cdnserver.util;

import java.util.Comparator;

public class CompareUtilMiddle implements Comparator<Object>
{
    public int compare(Object o0, Object o1)
    {
        SeedMiddle seed0 = null;
        SeedMiddle seed1 = null;
        if (o0 instanceof SeedMiddle && o1 instanceof SeedMiddle)
        {
            seed0 = (SeedMiddle) o0;
            seed1 = (SeedMiddle) o1;
        }
        else
        {
            return -2;
        }

        String link = seed0.getLink();
        String link1 = seed1.getLink();
        if (link1.length() > link.length())
        {
            return 1;
        }
        else if (link1.length() < link.length())
        {
            return -1;
        }
        return 0;
    }
}
